
var prefix = "/userAunt";

layui.use(['form', 'xmSelect', 'upload', 'laydate'], function () {
    var form = layui.form;
    laydate = layui.laydate;
    form.on('radio(demo-radio-filter)', function(data){

        if(data?.elem?.value=='1'){
            $('#refuseReason').show()
        }else {
            $('#refuseReason').hide()
            $("textarea[name='refuseReason']").val('');
        }

    });

    //提交事件
    form.on('submit(submit)', function (data) {
        let mn=$('#isSubmit').val()
        if(mn=='false'){
            let params=data.field
            if(null==params.auditResult){
                layer.msg('请进行审核')
                return
            }
            params.id=$('#userId').val()
            AjaxPost( '/userHouse/updateExamineHouse', params).then(function (response) {
                parent.layer.msg("操作成功");
                var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                parent.layer.close(index);
                parent.load();
            }).catch(error => {
                layer.msg(error.msg)
            })
        }else{
            var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
            parent.layer.close(index);
            parent.load();
        }

    });

});

